package com.mllweb.api.core.digest;



/**
 * @Prject: Api
 * @Package: com.mllweb.api.core.digest
 * @author: feejson
 * @date: 2017/9/20 15:47
 * @version: V1.0
 */
public class Base64 {
    /**
     * 编码
     *
     * @param binaryData
     * @return
     */
    public static String encode(byte[] binaryData) {
        return com.alibaba.druid.util.Base64.byteArrayToBase64(binaryData);
    }

    /**
     * 解码
     *
     * @param encoded
     * @return
     */
    public static byte[] decode(String encoded)  {
        return com.alibaba.druid.util.Base64.base64ToByteArray(encoded);
    }

    /**
     * 解码
     *
     * @param encoded
     * @return
     */
    public static String decodeAsHex(String encoded) {
        return new String(decode(encoded));
    }
}
